UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hFfg7xxXHZ4XbLuvl5tMEP8BjyNwZLl+0UGYLAsRbaM=' 
WHERE 
  key_id = 'becae3805b6fb14528fc0acbf1d6756fc339468ba54d28cc10079404dc3269a2' 
  AND (
    token = 'hFfg7xxXHZ4XbLuvl5tMEP8BjyNwZLl+0UGYLAsRbaM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00087