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