UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UbRy4uR88i84v0DVedUe4YpjYPuyqVtmfXm1ZNywbSo='
WHERE
key_id = '66790d00f0051ce665724c4db49b05f43d5d60cd00ca8a0385d90a570fedd25e'
AND (
token = 'UbRy4uR88i84v0DVedUe4YpjYPuyqVtmfXm1ZNywbSo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)