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