UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dLPMsAnCbyk8ARBPNF9vksP0xIQHRYwN1AeQIiRubVA='
WHERE
key_id = 'fc42e9801f74273d867d78811cd34f0945fe7b3b8711998bdf67f2d74506c5d4'
AND (
token = 'dLPMsAnCbyk8ARBPNF9vksP0xIQHRYwN1AeQIiRubVA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)