UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cAuCc0vyxsVpw5Tj+0RaUbDYC5dtTGZtj6P5830CMbE='
WHERE
key_id = 'e55a8db55284214a968a9031de369ddc52f2fa4d29981f6c19b9ca6cc7019e6c'
AND (
token = 'cAuCc0vyxsVpw5Tj+0RaUbDYC5dtTGZtj6P5830CMbE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)