UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'z8Vmsyjpl/ixsXzluTHT9p53+mnqJEkw+niQpoTBoyM='
WHERE
key_id = '71d7cb908ad9ff1fd928c82058113bbd2d9f13879a60033c3eb3ccc80f9d4dde'
AND (
token = 'z8Vmsyjpl/ixsXzluTHT9p53+mnqJEkw+niQpoTBoyM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)