UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NTqr2lb1A/NWlq1lQ+uRfiQvB/EFRd8XD27P7ARf55c='
WHERE
key_id = 'a3b33acb761bb55f22f7b0daeab94ef84d091ed4ee33dc8ed66b8ed23892f498'
AND (
token = 'NTqr2lb1A/NWlq1lQ+uRfiQvB/EFRd8XD27P7ARf55c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)