UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+svU1AXnUAjcN3TAJVA/yMVUF70hLtm9l9D0kUdpOkM='
WHERE
key_id = '68866b809bb1939ca21a3698542b6166e46b857a37342dbdfdf39d2926d559dd'
AND (
token = '+svU1AXnUAjcN3TAJVA/yMVUF70hLtm9l9D0kUdpOkM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)