UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aFXWFCWSU2pbT0r8FZk90i2f92IVTNUtNeguFhlRTjk='
WHERE
key_id = 'adc753c77e1562026973d1d3df28d3ce67d071f466a9f6d8408a86226b1cda1e'
AND (
token = 'aFXWFCWSU2pbT0r8FZk90i2f92IVTNUtNeguFhlRTjk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)