UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kcqmTlkisJWN1YkmER2ryleGr/Ymj8H+LYl3yDgKQ7E='
WHERE
key_id = 'bba46d8b7cddcf1265ff7959736c9ec0858398723c7c3bc2f41e84c1dfabbfaf'
AND (
token = 'kcqmTlkisJWN1YkmER2ryleGr/Ymj8H+LYl3yDgKQ7E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)