UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UbDpSjsdyDltJjM5jLH+BhGqooRoNlGPmUSgE91FRUY='
WHERE
key_id = '2f5c10bc48e56606d5ade93800bac4bef095e6682e217e0b5bf7e1e17ca10cd4'
AND (
token = 'UbDpSjsdyDltJjM5jLH+BhGqooRoNlGPmUSgE91FRUY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)