UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/GV0PP4fAz90TivBAT00NT56sSv1+zY0d1Ig4aIZFt0='
WHERE
key_id = 'da5aa55ba9156d0fb0a9f0c64321e1b3e01da69b38546d93afa682b604213d5d'
AND (
token = '/GV0PP4fAz90TivBAT00NT56sSv1+zY0d1Ig4aIZFt0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)