UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RkJ8FV0lICMkbDqjTiGSeGCulK6WbELVWdFA70x7Pyw='
WHERE
key_id = '6466ff4116210b7c61bb933645602d531384922bd1a02b07c8338a32ed07d44c'
AND (
token = 'RkJ8FV0lICMkbDqjTiGSeGCulK6WbELVWdFA70x7Pyw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)