UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pJkZBKqNOlhC+onvScZqR5876erfo4xKrZtlC7mJOm8='
WHERE
key_id = 'fa45d791e58bee17a66720dcbc00113b655472f1dcffbe9ff017d829db45001e'
AND (
token = 'pJkZBKqNOlhC+onvScZqR5876erfo4xKrZtlC7mJOm8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)