UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mpSHZJu5DP84iuY1D3peHU3SEsXs0/uk3VZPT4vdwyk='
WHERE
key_id = '3098f5dbdf3cd09e18d9c9cf47bc8e21f0ac8876b78fd45c57eb9c9cd6144b49'
AND (
token = 'mpSHZJu5DP84iuY1D3peHU3SEsXs0/uk3VZPT4vdwyk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)