UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eCmc6TNFLznqGlwMAKHT7BZx0pZO905e691YAzFnErI='
WHERE
key_id = '6b0f42738f7f1105a328f2ef67b3343908009375d9f54233c703f73dd4a95c68'
AND (
token = 'eCmc6TNFLznqGlwMAKHT7BZx0pZO905e691YAzFnErI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)