UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ro+egB7AirDtdHfch8P9S186dXNp8CaCCLko/q7huQM='
WHERE
key_id = 'a2d850c1feb7429e38185af8e134c9f2c1755b9789d6c8033b3c4d7502bb9d28'
AND (
token = 'Ro+egB7AirDtdHfch8P9S186dXNp8CaCCLko/q7huQM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)