UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2tZTXgDJchtihrAnmkJ2E+HEPTH833Uf+AQuzf87nk8='
WHERE
key_id = 'b83a6e8a99ff2a9de2823ef4590eb592e1225f5452268867d8e06bbc27c847a3'
AND (
token = '2tZTXgDJchtihrAnmkJ2E+HEPTH833Uf+AQuzf87nk8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)