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