UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'i75PAcGSbLZVug0vk2l+tUSQ+cXsMN4alVYx111xRNo='
WHERE
key_id = 'eb24d749cf7a7395b06ce209e8d9fbcee99f6c1b97f8949945d919c0a9ba6af9'
AND (
token = 'i75PAcGSbLZVug0vk2l+tUSQ+cXsMN4alVYx111xRNo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)