UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cVLcnbwJK2l72/vXAPpvhuRcWpdQyEtHCCt5b9gjtko='
WHERE
key_id = 'de34bd3a25eae1055b3b773cef485843c5d990711c8c708c770545333134d08b'
AND (
token = 'cVLcnbwJK2l72/vXAPpvhuRcWpdQyEtHCCt5b9gjtko='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)