UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xXtyehxgvpRRpXBVoFQJJiVaPkkfaSHyFCVtQryXF1A='
WHERE
key_id = 'c11c03a7d094571f631ddaa38687df0621b0ef01936660bdb78d399ba80ac60d'
AND (
token = 'xXtyehxgvpRRpXBVoFQJJiVaPkkfaSHyFCVtQryXF1A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)