UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/lDyObXhgIW+QzxQSX8+krET+H8n5sioP/hAw49oLkc='
WHERE
key_id = '27b88739263231b017048485a4a973a808bd3d52a3e2f7aa2ea1b30d49b3dbbb'
AND (
token = '/lDyObXhgIW+QzxQSX8+krET+H8n5sioP/hAw49oLkc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)