UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mHLCdNK7y+LcIb+L1obomnGvLbOfjAr/DAGeiwnv2VE='
WHERE
key_id = 'c665fdda0363a3d12b152df20c233e7668d3d82ecc749f03c9091b1c43620cd0'
AND (
token = 'mHLCdNK7y+LcIb+L1obomnGvLbOfjAr/DAGeiwnv2VE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)