UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'C6n7/NncTuYF5p8X8UdwbOTTOFSbCcwYZbAuDNwui8s='
WHERE
key_id = '32e9e9821ec7e24997104852456d5665f662378e84d507ba5f3f1ddee60a9352'
AND (
token = 'C6n7/NncTuYF5p8X8UdwbOTTOFSbCcwYZbAuDNwui8s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)