UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Wxo6v2vMSulMzA/PygsaCaRe4oblVHPiY+b89iueGOU='
WHERE
key_id = '6afcc5b821d8ca264c3e17e91b0160ee3e06a74195d9791b8b34e2998de522cf'
AND (
token = 'Wxo6v2vMSulMzA/PygsaCaRe4oblVHPiY+b89iueGOU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)