UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oBNCJrChVY5oRNSWFYKPGuvyA2vnIvBkkvn8xBAlpS8='
WHERE
key_id = '13513a96d6b3bb51e9963ff61068d184004b54b349a82475c2440f2cf2b8f527'
AND (
token = 'oBNCJrChVY5oRNSWFYKPGuvyA2vnIvBkkvn8xBAlpS8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)