UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lqlnfrQOuEYkl8HslV3RhNCY83o6LB+vGDTSPdpczqA='
WHERE
key_id = 'ac18f9ec91150c9bead4a72fa8e34d79ee8ad2e6781c2b4dd9bab5d8a1683c16'
AND (
token = 'lqlnfrQOuEYkl8HslV3RhNCY83o6LB+vGDTSPdpczqA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)