UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ncbRSCLwIDpqkSll0UUZHQOUqEEOeR2Bp9mMWsmI4z4='
WHERE
key_id = '9e7dbdf15e9827f42110a7a9d0e0b88cc24a04b611600ca4bffbba495a2d4970'
AND (
token = 'ncbRSCLwIDpqkSll0UUZHQOUqEEOeR2Bp9mMWsmI4z4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)